package com.steven.design.XingWei_Pattern.ZeRenLian;

/**
 * 责任链模式
 * 扩展性好，耦合度低，灵活性强，简化对象的连接
 * 不能保证每个请求都会被处理，链路太长影响效率， 可能出现循环调用。
 */
public class ZeRenLianTest {
    public static void main(String[] args) {
        Teacher teacher = new Teacher();
        BanZhuRen banZhuRen = new BanZhuRen();
        JiaoWuChu jiaoWuChu = new JiaoWuChu();
        teacher.setNext(banZhuRen);
        banZhuRen.setNext(jiaoWuChu);

        teacher.handler(11);
    }
}
